package com.ftg.learn.chapter08.isa.static1;

/**
 * @author kangjx
 * @createTime 2023/1/6
 */
public class Person {

    //1
    private static int index = 0;


    //2
    public Person(){
        index ++;
    }

    public static int getIndex() {
        return index;
    }

    public static void main(String[] args) {
        new Person();
        new Person();
        new Person();
        new Person();
        new Person();
        new Person();
        new Person();
        new Person();
        new Person();
        new Person();
        new Person();
        System.out.println(Person.getIndex());
    }

}
